/*
 * @Author: 噜噜雯雯 2199987619@qq.com
 * @Date: 2025-05-28 11:29:08
 * @LastEditors: 噜噜雯雯 2199987619@qq.com
 * @LastEditTime: 2025-07-03 09:46:37
 * @FilePath: \linePatrol\vue-element-plus-admin\src\api\linePatrol\index.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import service from '@/axios/http'
import { TableIResponse } from '@/utils/Api'
import { PipeLineDetailType, PipeLineInfoType, PipePointInfoType } from './type'
export class GisInfoApi {
  //返回管网拓扑树结构
  async GetPnTopologyTree(): Promise<any> {
    const result = (await service.get('/api/patrol/pnTopology/pnTopologyTree')) as unknown as any
    return result
  }
  //查询全部管线信息
  async GetPipeLineInfo(): Promise<PipeLineInfoType[]> {
    const result = (await service.get('/api/patrol/pipeLine/listAll')) as unknown as any
    const { data, code } = result
    if (code == 200) {
      return data
    } else {
      return []
    }
  }
  //查询全部管点信息
  async GetPipePointInfo(): Promise<PipePointInfoType[]> {
    const result = (await service.get('/api/patrol/facilityLedger/mapListAll')) as unknown as any
    const { data, code } = result
    if (code == 200) {
      return data
    } else {
      return []
    }
  }
  //查询所选巡查点
  async GetPipeLineDetail(uuid: string | undefined): Promise<PipeLineDetailType> {
    const result = (await service.get(`/api/patrol/pipeLine/map/${uuid}`)) as unknown as any
    const { code, data } = result
    if (code == 200) {
      return data
    } else {
      return {}
    }
  }
  //patrol/facilityLedger/list查询设施台账列表
  //查询分页管点信息
  async GetPipePointList(params: any): Promise<TableIResponse<PipePointInfoType[]>> {
    const result = (await service.get('/api/patrol/facilityLedger/list', {
      params
    })) as unknown as any
    return result
  }
  //查询分页管线信息
  async GetPipeLineList(params: any): Promise<TableIResponse<PipeLineInfoType[]>> {
    const result = (await service.get('/api/patrol/pipeLine/list', { params })) as unknown as any
    return result
  }
}
export default new GisInfoApi()
